<template>
  <iframe :src="url" class="iframe-container"></iframe>
</template>

<script>
import iFrame from '@/components/iFrame/index'
import { getToken } from '@/utils/auth'
import { getBiUrl } from '@/api/tool/jimu'

export default {
  name: 'ReportDesign',
  components: { iFrame },
  data() {
    return {
      url: ''
    }
  },
  created() {
    this.init()
  },
  methods: {
    init() {
      getBiUrl().then(res => {
        this.url = res + "?token=Bearer " + getToken()
      }).catch(error => {
        console.error('获取报表地址失败:', error)
        this.$modal.msgError('报表加载失败')
      })
    }
  }
}
</script>

<style scoped>
.iframe-container {
  width: 100%;
  height: calc(100vh - 84px);
  border: 0;
  overflow: hidden;
}
</style>
